package com.walker.spring.publisher;

import com.walker.spring.event.DemoEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

/**
 * @author qinmu
 * @create 2017-10-16-22:27
 */
@Component
public class DemoPublisher {
    @Autowired
    private ApplicationContext context;

    public void publish(String message) {
        context.publishEvent(new DemoEvent(this,message));
    }
}
